
<?php $template = 'templates/toppage-BG';?>
<?php $aut = new bgAuthorize();?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-gb" lang="en-gb" dir="ltr" >
   <meta http-equiv="content-type" content="text/html;charset=utf-8" />
   <head>
      <!-- <link href="<?php echo $template?>/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" /> -->
      <link rel="stylesheet" href="<?php echo $template?>/css/djmenu.css" type="text/css" />
      <link rel="stylesheet" href="<?php echo $template?>/css/djmenu_fx.css" type="text/css" />
      <link rel="stylesheet" href="<?php echo $template?>/css/custom.css" type="text/css" />

      <link href="<?php echo $template?>/css/reset.css" rel="stylesheet" type="text/css" />
      <link href="<?php echo $template?>/css/layout.css" rel="stylesheet" type="text/css" />
      <link href="<?php echo $template?>/css/modules.css" rel="stylesheet" type="text/css" />
      <link href="<?php echo $template?>/css/template.css" rel="stylesheet" type="text/css" />
      <link href="<?php echo $template?>/css/details.css" rel="stylesheet" type="text/css" />
      <link href="<?php echo $template?>/css/menus.css" rel="stylesheet" type="text/css" />
      <link href="<?php echo $template?>/css/editor.css" rel="stylesheet" type="text/css" />

      <link href="<?php echo $template?>/css/ltr.css" rel="stylesheet" type="text/css" />
      <!-- CSS POPUP -->
      <link rel="stylesheet" href="<?php echo $template?>/public/popup/css/zebra_dialog.css" type="text/css"/>
      <!--[if IE]>
            <script src="<?php echo $template?>/js/html5shiv.js"></script>
      <![endif]-->
      <script src="<?php echo $template?>/js/jquery.js" type="text/javascript"></script>

      <!-- JAVASCRIPT -->
      <script type="text/javascript" src="<?php echo $template?>/public/popup/js/zebra_dialog.js"></script>
      <?php if(JRequest::getVar('noHead')){
        $this->_scripts = array();
        $this->_script = array();
      }?>
       <jdoc:include type="head" />
        <script>
            var jq = jQuery.noConflict();
            jq.ajaxSetup({ cache: false });
            jq(document).ready(function(){
                jq('button[href]').click(function(e){
                    e.preventDefault();
                    $this = jq(this);
                    $textConfirm = $this.attr('title') ? $this.attr('title') : '選定された～を削除します。よろしいですか？';

                    if($this.hasClass('confirm')){
                        if(confirm($textConfirm)){
                            window.location.href = $this.attr('href');
                        }
                    }else{
                        window.location.href = jq(this).attr('href');
                    }


                });
            })

        </script>
      <script>
    function alertError(){
        /*alert("KHONG TIM THAY FILE");*/
        alert("ファイルが見つかりません。");
    }
</script>


   </head>
   <body>
      
      <div id="jm-all">
         <div id="jm-outer-all">
            <div id="jm-outer-in">
               <div id="jm-outer-page">
                  <div id="jm-outer">
                     <div id="jm-logo-topright" class="clearfix">
                        <div id="jm-logo-sitedesc">
                           <h1 id="jm-logo">
                              <a href="index.php?top=page" >
                              <img src="<?php echo $template?>/logo.jpg" alt="" border="0"/>
                              </a>
                           </h1>
                           <div id="slogan">
                                <p>海と緑のふれあい</p>
                                <p class="bot">スポーツ。健康。人づくり</p>
                           </div>
                        </div>

                        <div id="top-menu">
                            <ul>
                                <li><a href="index.php?top=page&option=com_sitemap">B&amp;G財団概要</a></li>

                                <li><a href="index.php?top=page&option=com_sitemap&task=sitemap">サイトマップ</a></li>
                                <li><a href="index.php?top=page&option=com_sitemap&task=manual">操作マニュアル</a></li>
                                <li><a href="index.php?top=page&option=com_sitemap&task=environment">動作環境</a></li>
                                <li><a href="index.php?option=com_login&task=logout&<?php echo JUtility::getToken().'=1'?>">ログアウト</a></li>
                            </ul>
                        </div>
                        <div style="float: left; width: 1004px">
                        <?php $u=JFactory::getUser();
                              $u_id= $u->id;
                              $u_name=$u->username;

                         ?>


                            <div id="text-logo">
                                <?php echo $u_name.'&nbsp';
                                     echo HelperBGtop::getNameOcba($u_id);
                                 ?>
                            </div>

                            <a href="index.php" class="admin-button">作成・編集</a>
                        </div>
                     </div>
                     <!-- MENU -->
                     <div id="jm-topmenu-in">
                        <div id="jm-topmenu" class="clearfix ltr">
                           <ul id="dj-main78" class="dj-main">
                                <?php foreach(bgData::getMenu() as $key=>$item){
                                    $acctive = '';
                                    if(JRequest::getVar('option') == $key){
                                        $acctive = 'active';
                                    }
                                ?>
                                  <li class="dj-up itemid437 first <?php echo $acctive; ?>">
                                    <a href="index.php?top=page<?php if($key != 'com_cpanel') echo '&option='.$key?>" class="dj-up_a active" ><span ><?php echo $item; ?></span></a>
                                  </li>
                                <?php } ?>
                           </ul>
                        </div>
                     </div>
                     <!-- END MENU -->
                     <div id="jm-content-top-out">
                        <div id="jm-content-top" class="clearfix  ">
                           <div id="jm-wrapper" class="scheme_2 ">
                            <!-- COMPONENT -->
                            <?php if(JRequest::getVar('option') != 'com_cpanel'):
                                  $doc = JFactory::getDocument();
                                  $doc->addStyleSheet( $template.'/css/two.css' );
                            ?>
                                <div id="jm-main" class="clearfix two">
                                    <jdoc:include type="component" />
                                    <div class="float-right"><a href="#" >ページの先頭へ</a>
                                        <img width="41" align="absmiddle" height="23" src="<?php echo $template?>/images/bottom_iruka.gif"/>
                                    </div>
                                </div>
                            <?php else : ?>
                              <div id="jm-main" class="clearfix">
                                 <!-- LEFT -->
                                 <div id="jm-left" class="" >
                                    <div class="jm-module " id="">
                                       <div class="jm-module-content">
                                          <h3 class="jm-title">インフォメーション</h3>
                                          <?php

                                          $rows= HelperBGtop::getAllInfo($u_id);

                                          if ($rows !=null)
                                                {
                                                   foreach($rows as $row)
                                                    {
                                            ?>
                                         <div class="content-info">
                                              <h2><?php echo $row->CAIN_NAME; ?><span class="float-right"><a href="index.php?top=page&option=com_frinformation&task=defaut&c_cid[0]=<?php echo $row->CAIN_CODE; ?>&u_cid[0]=<?php echo $row->USIN_USER_CODE; ?>" class="arrow">一覧はこちら</a></span></h2>
                                                  <?php
                                                        if($row->data != null){
                                                        foreach($row->data as $k=>$data){
                                                    ?>
                                              <div class="jm-content">
                                                    <div class="news">
                                                    <?php
                                                        $c =date('Y/m/d');
                                                        $d= $data->INFO_DATE;
                                                        $d = date('Y/m/d', strtotime($d) );
                                                        $dn=strtotime($c)-strtotime($d);
                                                        $num=$dn/86400;
                                                        $item=bgData::getNumNew();
                                                        $item=$item-1;
                                                        if ($num<=$item)
                                                            {
                                                                echo '<p class="icon-new">NEW!!</p>';
                                                            }
                                                                else echo '<p></p>'

                                                        ?>

                                                        <div class="content-new">

                                                            <p class="date"><?php echo $d;  ?></p>
                                                            <a href="index.php?top=page&option=com_frinformation&task=detail&cid[0]=<?php echo $data->INFO_CODE; ?>"><?php echo $data->INFO_TITLE; ?></a>
                                                        </div>
                                                    </div>
                                              </div>
                                              <?php } } ?>

                                          </div>
                                          <?php
                                                }
                                            }
                                            else
                                            {
                                                echo '<center>新しい情報はありません。</center>';
                                            }
                                          ?>

                                          <div class="clearfix"></div>

                                       </div>
                                    </div>

                                 </div>
                                 <!-- END LEFT -->
                                 <!-- MIDDLE -->
                                 <div id="jm-left" class="middle" >
                                    <?php if($aut->getUserGroup() != '12'){ ?>
                                    <div class="jm-module " id="Mod31">
                                       <jdoc:include type="modules" name="message" style="none" />
                                    </div>
                                    <?php } ?>
                                    <div class="jm-module ">
                                       <div class="jm-module-content">
                                          <h3 class="jm-title">活動情報<span class="float-right"><a href="index.php?top=page&option=com_fractivitive" class="arrow">一覧はこちら</a></span></h3>
                                          <div class="content-info last">
                                            <?php

                                                $rows= HelperBGtop::getAllAct($u_id);
                                                if ($rows !=null)
                                                {
                                                   foreach($rows as $row)
                                                    {
                                            ?>
                                              <div class="jm-content">
                                                    <div class="news">
                                                        <?php
                                                        $c =date('Y/m/d');
                                                        $a= $row->ACTT_DATE;
                                                        $a = date('Y/m/d', strtotime($a) );
                                                        $d=strtotime($c)-strtotime($a);
                                                        $num=$d/86400;
                                                        $item=bgData::getNumNew();
                                                        $item=$item-1;
                                                        if ($num<=$item)
                                                            {
                                                                echo '<p class="icon-new">NEW!!</p>';
                                                            }
                                                                else echo '<p></p>'

                                                        ?>

                                                        <div class="content-new">
                                                            <p class="date"><?php echo $a;  ?></p>
                                                            <a href="index.php?top=page&option=com_fractivitive&task=detail&cid=<?php echo $row->ACTT_CODE; ?>"><?php echo $row->ACTT_NAME;  ?></a><br />
                                                            [<?php echo $row->OCBA_NAME;  ?>]

                                                        </div>
                                                    </div>
                                              </div>
                                              <?php
                                                    }
                                                }
                                                 else
                                                    {
                                                        echo '<center>新しい活動情報はありません。</center>';
                                                    }
                                              ?>
                                          <div class="clearfix"></div>

                                       </div>
                                    </div>
                                    </div>
                                    <!-- DOWNLOAD PDF -->
                                    <div class="jm-module ">
                                       <div class="jm-module-content">
                                          <h3 class="jm-title">ダウンロード集<span class="float-right"><a href="index.php?top=page&option=com_frdownload" class="arrow">一覧はこちら</a></span></h3>
                                          <div class="content-info last">
                                                <?php

                                                    $rows= HelperBGtop::getAllDownd($u_id);
                                                    if ($rows !=null)
                                                    {
                                                ?>
                                              <div class="jm-content">
                                                    <?php
                                                        foreach($rows as $row)
                                                        {
                                                    ?>
                                                    <div class="news">
                                                        <?php
                                                        $path= $row->DOWI_PATH;
                                                        $so=strpos($path,".");
                                                        $so=$so+1;
                                                        $path=substr($path,$so,4);
                                                        if (trim($path)=='pdf')
                                                        {
                                                            echo '<p class="icon-pdf"></p>';
                                                        }
                                                        else if(trim($path)=='doc' or (trim($path)=='docx'))
                                                        {
                                                            echo '<p class="icon-word"></p>';
                                                        }
                                                         else if(trim($path)=='slsx' or (trim($path)=='xls'))
                                                        {
                                                            echo '<p class="icon-exel"></p>';
                                                        }
                                                        else if(trim($path)=='zip')
                                                        {
                                                            echo '<p class="icon-zip"></p>';
                                                        }
                                                        else if(trim($path)=='rar')
                                                        {
                                                            echo '<p class="icon-rar"></p>';
                                                        }
                                                        else if(trim($path)=='txt')
                                                        {
                                                            echo '<p class="icon-text"></p>';
                                                        }
                                                        else if(trim($path)=='csv')
                                                        {
                                                            echo '<p class="icon-csv"></p>';
                                                        }
                                                        else if(trim($path)=='png' || trim($path)=='gif' || trim($path)=='jpg' || trim($path)=='PNG' || trim($path)=='GIF' || trim($path)=='JPG')
                                                        {
                                                            echo '<p class="icon-png"></p>';
                                                        }
                                                        else if(trim($path)=='mp3' || trim($path)=='avi' || trim($path)=='mp4')
                                                        {
                                                            echo '<p class="icon-mp3"></p>';
                                                        }
                                                        else
                                                        {
                                                            echo '<p class="icon-other"></p>';
                                                        }
                                                        ?>
                                                            <div class="content-new">
                                                            <?php

                                                                $file_name = HelperBGtop::getDowiPath($row->DOWI_CODE);
                                                                $dowi_path  = "download.php?folder=files/com_download&file=".$file_name;

                                                                $check_file = "uploads/files/com_download/$file_name";

                                                                if(file_exists($check_file)){
                                                                  $size_of_file = HelperBG::filesize_formatted($check_file); //get size of file
                                                                ?>
                                                                <a href="<?php echo $dowi_path; ?>"><?php echo $row->DOWI_NAME ;?><br />
                                                                        <?php echo '('.$row->DOWI_DESCRIPTION.' '.$size_of_file.')'; ?>
                                                                </a>
                                                            <?php
                                                                }
                                                                else
                                                                {
                                                                    ?>
                                                                    <a href="javascript:alertError();"><?php echo $row->DOWI_NAME; ?><br />
                                                                    <?php echo '('.$row->DOWI_DESCRIPTION.')'; ?></a>
                                                               <?php
                                                                }
                                                                ?>
                                                        </div>
                                                    </div>
                                                    <?php } ?>
                                              </div>
                                              <?php

                                                }
                                              ?>

                                          </div>


                                          <div class="clearfix"></div>
                                         </div>
                                       </div>

                                    <!-- END DOWNLOAD PDF -->

                                    <div class="jm-module ">
                                       <div class="jm-module-content chart">
                                          <h3 class="jm-title" >センター全国累計（過去3年分）
                                            <span class="float-right"><a href="javascript: void(0);" id="show-chart-popup" class="arrow" >詳しくはこちら</a></span>
                                          </h3>
                                          <div class="jm-mod-content">
                                            <div id="chart-content" style="width: 342px; height: 240px; cursor: pointer;">
                                                <div style="width: 64px; height: 64px; position: relative; top: 88px; left: 139px;">
                                                    <img src="<?php echo $template?>/images/loading.gif" style="max-height:100%; max-width:100%;"/>
                                                </div>
                                            </div>
                                          </div>
                                       </div>
                                    </div>
                                 </div>
                                 <!-- END MIDDLE -->
                                 <!-- RIGHT -->
                                 <div id="jm-right" class="" >

                                    <div class="jm-module">
                                       <div class="jm-module-content top-right">
                                          <?php
                                                    $img_banners =  HelperBGtop::getAllImgFromMaster();
                                                    if($img_banners != null){
                                                        foreach($img_banners as $val){
                                                            if($val->BANNER_CODE == 1 || $val->BANNER_CODE == 2){
                                                ?>
                                                    <a target="_blank" href="<?php echo $val->BANNER_URL; ?>" ><img style="margin: 0 0 0 0;" src="uploads/images/com_msbanner/<?php echo $val->BANNER_IMG; ?>" alt="no banner"/></a>
                                                <?php
                                                                if($val->BANNER_CODE == 1){
                                                                    echo '<br />';
                                                                }
                                                            }
                                                        }
                                                    }

                                                ?>
                                       </div>
                                    </div>

                                    <div class="jm-module">
                                       <div class="jm-module-content">
                                          <h3 class="jm-title3">お役立ちツール</h3>
                                          <div class="jm-mod-content">
                                             <ul id="menu-right">
                                             <!-- Load all link-->
                                               <?php $rows= HelperBGtop::getLink();
                                                    if ($rows !=null)
                                                    {
                                                        foreach($rows as $row)
                                                        {

                                                ?>
                                                    <li><a href="<?php echo $row->LINK_URL ?>" target="_blank"><?php echo $row->LINK_NAME ?></a></li>
                                                <?php }  }?>
                                             </ul>
                                             <div id="search-ads">
                                                <form class="google" action="http://www.google.co.jp/search" target="_blank" method="get">
                                                    <img src="<?php echo $template?>/google.jpg"/>
                                                    <input type="text" name="q" size="11"/>
                                                    <input type="submit" value="検 索"/>
                                                </form>
                                                <form class="mapion" action="http://www.mapion.co.jp/c/f" target="_blank">
                                                    <img src="<?php echo $template?>/logo_mapion.gif"/>
                                                    <select name="admi2">
                                                        <option value="">都道府県
                                                        </option><option value="">指定しない
                                                        </option><option value="01">北海道
                                                        </option><option value="02">青森県
                                                        </option><option value="03">岩手県
                                                        </option><option value="04">宮城県
                                                        </option><option value="05">秋田県
                                                        </option><option value="06">山形県
                                                        </option><option value="07">福島県
                                                        </option><option value="08">茨城県
                                                        </option><option value="09">栃木県
                                                        </option><option value="10">群馬県
                                                        </option><option value="11">埼玉県
                                                        </option><option value="12">千葉県
                                                        </option><option value="13">東京都
                                                        </option><option value="14">神奈川県
                                                        </option><option value="15">新潟県
                                                        </option><option value="16">富山県
                                                        </option><option value="17">石川県
                                                        </option><option value="18">福井県
                                                        </option><option value="19">山梨県
                                                        </option><option value="20">長野県
                                                        </option><option value="21">岐阜県
                                                        </option><option value="22">静岡県
                                                        </option><option value="23">愛知県
                                                        </option><option value="24">三重県
                                                        </option><option value="25">滋賀県
                                                        </option><option value="26">京都府
                                                        </option><option value="27">大阪府
                                                        </option><option value="28">兵庫県
                                                        </option><option value="29">奈良県
                                                        </option><option value="30">和歌山県
                                                        </option><option value="31">鳥取県
                                                        </option><option value="32">島根県
                                                        </option><option value="33">岡山県
                                                        </option><option value="34">広島県
                                                        </option><option value="35">山口県
                                                        </option><option value="36">徳島県
                                                        </option><option value="37">香川県
                                                        </option><option value="38">愛媛県
                                                        </option><option value="39">高知県
                                                        </option><option value="40">福岡県
                                                        </option><option value="41">佐賀県
                                                        </option><option value="42">長崎県
                                                        </option><option value="43">熊本県
                                                        </option><option value="44">大分県
                                                        </option><option value="45">宮崎県
                                                        </option><option value="46">鹿児島県
                                                        </option><option value="47">沖縄県
                                                        </option>
                                                    </select>

                                                    <input type="text" name="google" size="21"/>
                                                    <input type="submit" value="検 索"/>
                                                </form>
                                                <div id="banner">
                                                <?php
                                                    $img_banners =  HelperBGtop::getAllImgFromMaster();
                                                    if($img_banners != null){
                                                        $i = 0;
                                                        foreach($img_banners as $val){
                                                        $i++;
                                                        if($val->BANNER_CODE != 1 && $val->BANNER_CODE != 2){
                                                ?>
                                                    <a target="_blank" href="<?php echo $val->BANNER_URL; ?>"><img src="uploads/images/com_msbanner/<?php echo $val->BANNER_IMG; ?>" alt="no banner" width="102px" height="40px" /></a>

                                                <?php
                                                                if($i == 2){
                                                                    echo "<br/>";
                                                                }
                                                            }
                                                        }
                                                    }

                                                ?>
                                                </div>


                                             </div>
                                          </div>
                                       </div>
                                    </div>

                                 </div>
                                 <!-- END RIGHT -->
                              </div>
                                <div class="float-right"><a href="#" >ページの先頭へ</a>
                                    <img width="41" align="absmiddle" height="23" src="<?php echo $template?>/images/bottom_iruka.gif"/>
                                </div>
                                <script type="text/javascript" src="https://www.google.com/jsapi"></script>
                                <script type="text/javascript">
                                    //load chart API
                                    google.load('visualization', '1', {packages: ['corechart']});
                                    google.load('visualization', '1', {packages: ['table']});
                                </script>
                                <script src="<?php echo $template?>/js/top.js" type="text/javascript"></script>
                              <?php endif ?><!-- END COMPONENT -->


                           </div>
                        </div>
                     </div>

                  </div>
               </div>
               <div id="jm-bottom" class="clearfix">
                  <div style="margin-top:-10px;">
                    <img src="templates/toppage-BG/images/support-logo_2.png" alt="no banner" width="20%"/>
                    <label id="jm-design-bottom">このシステムは、ボートレースの交付金による日本財団の助成により制作いたしました。</label>
                  </div>
                  <label id="jm-design">Copyright 2013 Blue Sea and Green Land Foundation. All right reserved.</label>
               </div>
            </div>
         </div>
      </div>
		
   </body>
   <!-- Mirrored from templates.design-joomla.eu/joomla16/dj-insurance/ by HTTrack Website Copier/3.x [XR&CO'2013], Fri, 05 Jul 2013 04:29:15 GMT -->
</html>
